<div class="login">
    <div class="login-bg">
        <!-- <div class="language-box" #languagebox (focus)="onShow()" (blur)="onHide()" tabindex="1">
            <a>
                <img *ngIf="lang.lang === 'zh'" src="../../../assets/icons/Country/china.png" />
                <img *ngIf="lang.lang === 'jp'" src="../../../assets/icons/Country/jp.png" />
            </a>
            <div class="language-select" [hidden]="!langShow">
                <div (click)="changeLang('zh')"><img src="../../../assets/icons/Country/china.png" /></div>
                <div (click)="changeLang('jp')"><img src="../../../assets/icons/Country/jp.png" /></div>
            </div>
        </div> -->
        <div style="display: flex;">
            <div class="login-title">推广商</div>
            <div class="in-out" *ngIf="!user?.id" (click)="showlogin()">去登录</div>
            <div class="in-out" *ngIf="user?.id" (click)="showout()">退出</div>
        </div>
        <div class="login-h">
            <div class="login-user">
                <img src="{{user.logo ? user.logo : '../../../assets/icons/h.png'}}" alt="">
                <p>{{user.loginId}}</p>
            </div>
            <div class="login-Balance" *ngIf="user?.id">
                <p>余额(Jpoint)</p>
                <div style="
                width:11.25rem;
                height:2.25rem;
                background:rgba(255,255,255,1);
                border-radius:18px;color: #206CDC;">
                    {{user.availableBalance}}
                </div>
            </div>
        </div>
    </div>
    <div class="login-body" *ngIf='isLogin'>
        <div class="form-databody white-input">
            <form [formGroup]="registerEmailForm" (ngSubmit)="onSave(registerEmailForm)">

                <div class="weui-cell weui-cell_vcode">
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" placeholder="{{'registerPage.input-mail' | translate}}"
                            formControlName="email" name="email" />
                    </div>
                    <div class="weui-cell__ft"
                        *ngIf='!registerEmailForm.controls.email.valid && registerEmailForm.controls.email.dirty'>
                        <i style="width: 2rem;margin-left: 1rem;" class="weui-icon-warn"></i></div>
                </div>

                <div class="weui-cell weui-cell_vcode">
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="password"
                            placeholder="{{'loginPage.input-password' | translate}}" formControlName="password"
                            name="password" />
                    </div>
                    <div class="weui-cell__ft" *ngIf='registerEmailForm.errors?.newConfirmPasswordError'><i
                            style="width: 2rem;margin-left: 1rem;" class="weui-icon-warn"></i></div>
                </div>

                <div class="register-subbtn">
                    <button weui-button disabled='{{!registerEmailForm.valid}}'>{{'login' | translate}}</button>
                </div>

                <div class="login-to-register">
                    <a style='margin: auto;
                    margin-left: 0;' routerLink="/register">{{'register' | translate}}</a>
                    <a style='margin: auto;
                    margin-right: 0;' routerLink="/updatePwd">{{'loginPage.forget-password' | translate}}</a>
                </div>
            </form>
        </div>
    </div>

    <div *ngIf='!isLogin'>
        <div class="login-body fx">
            <div class="body-top">
                <h2>累计邀请</h2>
                <p>{{user.userCount}}</p>
            </div>
            <div class="body-top">
                <h2>累计消费</h2>
                <p>{{user.waitingBalance}}</p>
            </div>
            <div class="body-top">
                <h2>未提现</h2>
                <p>{{user.availableBalance - user.withdrawalTotalBalance}}</p>
            </div>
        </div>
    </div>

    <div *ngIf='!isLogin' class="menu-body fx">
        <div class="menu" (click)="menuClick('账户信息')">
            <div>
                <img style="width: 100%;height: 100%;" src="../../../assets/images/login-page/zhxx-icon.png" alt="">
            </div>
            <p>账户信息</p>
        </div>
        <div class="menu" (click)="menuClick('推广配置')">
            <div>
                <img style="width: 100%;height: 100%;" src="../../../assets/images/login-page/tgpz-icon.png" alt="">
            </div>
            <p>推广配置</p>
        </div>
        <div class="menu" (click)="toSite()">
            <div>
                <img style="width: 100%;height: 100%;" src="../../../assets/images/login-page/zdpz-icon.png" alt="">
            </div>
            <p>站点配置</p>
        </div>
        <div class="menu" (click)="menuClick('消费明细')">
            <div>
                <img style="width: 100%;height: 100%;" src="../../../assets/images/login-page/xfmx-icon.png" alt="">
            </div>
            <p>消费明细</p>
        </div>
        <div class="menu" (click)="menuClick('我的结算')">
            <div>
                <img style="width: 100%;height: 100%;" src="../../../assets/images/login-page/wdjs-icon.png" alt="">
            </div>
            <p>我的结算</p>
        </div>
        <div class="menu" (click)="menuClick('我的消息')">
            <div>
                <img style="width: 100%;height: 100%;" src="../../../assets/images/login-page/wdxx-icon.png" alt="">
            </div>
            <p>我的消息</p>
        </div>
    </div>
    <div class="fixed-box" *ngIf="dialogShow">
        <div class="pay-sure-box">
            <h3>{{'MSG.chickout-msg' | translate}}</h3>
            <div style="display: flex;">
                <button class="btn-primary" (click)="chickOut()">{{'OK' | translate}}</button>
                <button class="btn-default" (click)="cancel()">{{'cancel' | translate}}</button>
            </div>
        </div>
    </div>
</div>
